package co.fitstart.market.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.GenericDaoSupport;
import com.demo2do.core.persistence.annotation.Dynamic;

import co.fitstart.entity.market.MarketCourseRound;
import co.fitstart.entity.user.User;
import co.fitstart.market.dao.MarketCourseRoundDao;
import co.fitstart.market.service.MarketCourseRoundService;

/**
 * 
 * @author dan
 *
 */
@Service("marketCoursewareService")
public class MarketCourseRoundServiceImpl implements MarketCourseRoundService{
    
    @Dynamic
    private MarketCourseRoundDao marketCourseRoundDao;
    
    @Autowired
    private GenericDaoSupport genericDaoSupport;

    /*
     * (non-Javadoc)
     * @see co.fitstart.market.service.MarketCourseRoundService#load(co.fitstart.entity.user.User)
     */
    public MarketCourseRound load(User user) {
        return marketCourseRoundDao.loadRound(user);
    }
    
    /*
     * (non-Javadoc)
     * @see co.fitstart.market.service.MarketCourseRoundService#joinGroup(co.fitstart.entity.market.MarketCourseRound)
     */
    public void joinGroup(MarketCourseRound marketCourseRound) {
        genericDaoSupport.update(marketCourseRound.joinGroup());
    }

}
